package edu.ustb.listener;

import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import edu.ustb.domain.GoodsType;
import edu.ustb.service.GoodsTypeService;
import edu.ustb.service.GoodsTypeServiceImpl;
@WebListener
public class InitListener implements ServletContextListener {
    public void contextDestroyed(ServletContextEvent arg0)  { 
    }
    
    public void contextInitialized(ServletContextEvent arg0)  { 
         ServletContext application = arg0.getServletContext();
         
         GoodsTypeService service = new GoodsTypeServiceImpl();
         List<GoodsType>gtl=service.showAll();
         application.setAttribute("goodsTypeList", gtl);
    }
	
}
